<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <ul>
            <li>小王</li>
            <li>中王</li>
            <li>老王</li>
        </ul>

        <ul>
            <li v-for="(person,index) in persons" :key="person.id">{{person.name}} -- {{index}}</li>
        </ul>
    </div>
    <script src="./js/vue.js"></script>
    <script>
        const vm = new Vue({
            data: {
                persons: [
                    { id: 1, name: "小王" },
                    { id: 2, name: "中王" },
                    { id: 3, name: "老王" },
                ]
            }
        });
        vm.$mount("#app");
    </script>
</body>

</html>